package mt.comm;

import java.io.Serializable;

import mt.Order;

public class ServerSideMessageImp implements ServerSideMessage, Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Type type;
	private String nickname;
	private Order order;
	/**
	 * This construct is for send an message to the server without the need to send an order
	 * @param type of the message to send
	 * @param nickname the client nickname
	 */
	public ServerSideMessageImp(Type type, String nickname) {

		this.type = type;
		this.nickname = nickname;
	}
	/**
	 * This construct is to send every kiind of message to the server
	 * @param type of the message to send
	 * @param nickname the client nickname
	 * @param order the order to the server
	 */
	
	public ServerSideMessageImp(Type type, String nickname, Order order) {
		this.type = type;
		this.nickname = nickname;
		this.order = order;
	}

	@Override
	public Type getType() {
		return type;
	}

	@Override
	public String getSenderNickname() {
		return nickname;
	}

	@Override
	public Order getOrder() {
		return order;
	}

}
